const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld('main_API', {
    injectScript: () => ipcRenderer.invoke('inject-script'),
    injectStyle: () => ipcRenderer.invoke('inject-css'),
    injectLanguageFile: () => ipcRenderer.invoke('inject-LanguageFile'),
    getTourDataID: () => ipcRenderer.invoke('get-tour-data-id'),
    openMap: () => ipcRenderer.send('open-map'),
    saveListData: (data, mergeCells) => ipcRenderer.send('save-list-data', data, mergeCells),
    getListData: () => ipcRenderer.invoke('get-list-data'),
    getListData_merge: () => ipcRenderer.invoke('get-list-data-merge'),
    changeTourDatesActualNum: (num) => ipcRenderer.send('change-tour-dates-actualNum', num),
    savePoiInfo: (row, col, rowspan, placeTitle) => ipcRenderer.send('save-poi-info', row, col, rowspan, placeTitle),
})